<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use backend\assets\AdminAsset;

StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/shop/info-goods.js'),AdminAsset::class);
?>

<div class="layui-form-item">
    <a class="a1 layui-btn layui-btn-primary">查看商家信息</a>
    <a class="a2 layui-btn">查看商品列表</a>
    <a class="a3 layui-btn layui-btn-primary">查看活动列表</a>
</div>
<div class="layui-card">
    <div class="layui-card-header">商品列表</div>
    <div class="layui-card-body">
        <form class="layui-form" method="get" id="form1">
            <div class="layui-form-item">
                <label>名称</label>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <input type="tel" name="goods_name"  autocomplete="off" class="layui-input">
                    </div>
                </div>
                <label>商品分类</label>
                <div class="layui-inline">
                    <select class="oneclass" name="tree_id" lay-filter="one">
                        <option value="0">请选择主营类目</option>
                        <?php foreach ($trees as $val):?>
                            <option value="<?=$val['id']?>"><?=$val['tree_name']?></option>
                        <?php endforeach;?>
                    </select>
                </div>
                <div class="layui-inline">
                    <select class="twoclass" name="two_id" lay-filter="two">
                        <option value="0">请选择二级分类</option>
                        <?php if(!empty($twodata)):?>
                            <?php foreach ($twodata as $val):?>
                                <option value="<?= $val['id']?>"><?= $val['tree_name']?></option>
                            <?php endforeach;?>
                        <?php endif;?>
                    </select>
                </div>
                <div class="layui-inline">
                    <select class="threeclass" name="three_id">
                        <option value="0">请选择三级分类</option>
                        <?php if(!empty($threedata)):?>
                            <?php foreach ($threedata as $val):?>
                                <option value="<?= $val['id']?>"><?= $val['tree_name']?></option>
                            <?php endforeach;?>
                        <?php endif;?>
                    </select>
                </div>
                <input type="hidden" name="id" id="id" value="<?=$id?>"/>
                <div class="layui-inline">
                    <button class="layui-btn" lay-submit lay-filter="serch-form">搜索</button>
                </div>
            </div>
        </form>
        <div class="layui-form-item">
            <table id="goodsList" lay-filter="goodsList"></table>
        </div>
        <div class="layui-form-item">
            <a class="layui-btn layui-btn-primary back">返回</a>
        </div>
    </div>
</div>



<script type="text/html" id="getSKU">
    <a class="layui-btn layui-btn-xs" lay-event="getsku">查看sku</a>
</script>
<script type="text/html" id="operation2">
    <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
</script>